package com.pbdemo.config;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import xyz.noark.core.lang.ByteArray;
import xyz.noark.network.codec.protobuf.ProtobufLengthEncoder;

public class PbLengthEncoder extends ProtobufLengthEncoder {
    @Override
    protected void encode(ChannelHandlerContext ctx, ByteArray msg, ByteBuf out) {
        out.writeShort(msg.length());
        out.writeBytes(msg.array());
    }
}
